package main

import "fmt"

// 测试new struct是内存地址引用

type Stutent struct {
	Book string `json:"book"`
}

func (this *Stutent) Set(book string) {
	this.Book = book
}

func main() {
	s1 := new(Stutent) // 返回一个指针
	s1.Set("math")
	var s *Stutent
	s = s1 // 指针拷贝，实际就是内存地引用
	s.Set("english")
	fmt.Println(s.Book, s1.Book)
}
